﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Reflection;
using System.Data;
using WsProtocol.IEC62056;


namespace WsProtocol.IEC62056MDL
{
    /// <summary>
    /// 参数窗口类型
    /// </summary>
    public enum TFormType : int
    {
        无 = 0,
        日期时间带周次毫秒 = 1,  //日期时间带周次毫秒
        //日期时间无周次 = 2,  //日期时间        
        日期带周次 = 3,       //日期
        时间 = 4,      //时间
        下拉框 = 5,   //下拉框
        单选框 = 6,   //单选框
        数字框 = 7,     //上下框
        文本框 = 8,     //文本框
        格式输入 = 9,     //格式框
        多选框 = 10,      //多选框
        第7类抄读Buffer参数 = 11,  //
        数组类型对象参数 = 12,  //数组类型对象专用
        数组类型纵向展示 = 13,  //数组类型对象专用       
        时间间隔 = 14,     //时间间隔
        只读 = 15,
        显示参数 = 16,      //显示参数
        数据类型任选的参数 = 17
      //  时段表 = 17       //时段表参数窗口
    }

    //设置时，元素用于组织设置数据节点，格式为设置返回的附加数据解析节点；
    public enum AttrType : int
    {
        属性 = 1,
        方法 = 2,
        元素 = 3,
        格式 = 4 
    }  

   
    //自定义安全验证等级
    public enum AuthenticationExpand
    {
        NoAuth = 0,
        //LLS = 1,
        LLS1 = 11,
        LLS2 = 12,
        LLS3 = 13,
       // HLS = 2,        
        //HLS_MD5 = 3,
        //HLS_SHA_1 = 4,
        HLS_GMAC = 5,
        //HLS_SHA_256 = 6,
        //HLS_ECDSA = 7,
    }

    
    public enum TAttrAccess{Read, Write, authenticated_request, encrypted_request, digitally_signed_request,
                            authenticated_response, encrypted_response, digitally_signed_response };

    public enum TMthAccess{access, not_used, authenticated_request, encrypted_request, digitally_signed_request,
                           authenticated_response, encrypted_response, digitally_signed_response};

    public enum DefRoleAddr { 
        公共客户端 = 16,
        管理客户端 = 01
    }


    public enum eleNodeType
    {
        Data = 0,  //设置参数或抄读的数据节点
        AppendPar = 1  //设置或抄读时的附加参数节点
    }

    public enum TWeek  //可选星期
    { 
        Mon = 1,
        Tues = 2,
        Wed = 3,
        Thurs = 4,
        Fri = 5,
        Sat = 6,
        Sun = 7
        //Not_Specified = 255
    }

    //public enum UDPCAddr  //UDP可选客户端地址
    //{ 
    //    No_station = 0,
    //    Client_Management_Process = 1,
    //    Public_Client = 16
    //}


    public enum UDPSAddr  //UDP可选服务端地址
    {
        No_station = 0,
        Management_Logical_Device = 1,
        All_station = 127
    }


    public enum MeterHas //对象
    { 
        表库都有 = 0,  //表与数据库都存在
        库有表缺 = 1,  //数据库存在但表不支持
        表有库缺 = 2,  //表支持但数据库缺

    } //
    public class PtlConsts
    {
        //public static EasyDb easyDb = null;  //数据库操作对象
        public static string AddrCAD = "23.0.0.22.0.0.255.9.0"; //通信地址CAD 类ID.OBIS.属性序号.元素序号
        public static string MeterNoOBIS = "40020200"; //表号OBIS
        public static string BrOBISCastOBIS = "40007F00"; //广播校时OBIS
        public static int BrOBISCastAddr1 = 127;  //7f
        public static int BrOBISCastAddr2 = 16383; //3fff
        public static string AssLNOBIS = "0.0.40.0.0.255"; //LN 连接类对象OBIS
        public static string BkeyFCOBIS = "0.0.43.1.1.255"; //Receive frame counter  - broadcast key
        public static string UkeyFCOBIS = "0.0.43.1.0.255"; //Receive frame counter - unicast key
        public static byte[] SoftCompareFile; //程序比对文件
        public static string LanType = "en";        //语言种类
        public static int defApduSize = 128;//默认设数据单元最长为128字节
        public static string INIFileName = @"Par62056.ini";  //保存加密参数的配置文件
        
        public static List<TMeterTypeRole> roleLst = new List<TMeterTypeRole>();//hxh 角色列表



    }
}
